package com.thrsdk.manager;

import android.content.Context;

import com.thrsdk.constants.AppConstants;
import com.thrsdk.model.data.BaseUserData;
import com.thrsdk.model.protocol.bean.LoginMessage;

import java.util.ArrayList;
import java.util.List;

/**
 * Created on 2021/7/29.
 */
public class AccountManager {
    private static AccountManager sInstance;
    private List<BaseUserData> mHistoryUserList = new ArrayList<>();    //登录历史记录
    private Context mContext;

    private AccountManager(Context context) {
        mContext = context;
    }

    public static AccountManager getInstance(Context context) {
        if (sInstance == null) {
            sInstance = new AccountManager(context);
        }
        return sInstance;
    }

    public static void setLoginMessage(LoginMessage loginMessage){
        if (loginMessage == null){
            return;
        }
        /**
         * 将登录信息需要频繁使用的参数设置为全局参数
         * 需要使用则去AppConstants类取
         */
//        AppConstants.userName = loginMessage.getUname();
//        AppConstants.uid = loginMessage.getUid();
//        AppConstants.gametoken = loginMessage.getGametoken();
    }

    public static void logout(){
        AppConstants.openId ="";
		AppConstants.token = "";

    }
}
